

//定义一个学生类（Student），包含姓名（name）和成绩（score）属性，提供一个静态方法计算
//        所有学生的平均成绩，并提供getter和setter方法。

package Job.thirtyFour;

public class Student {
    private String name;
    private double score;

    public Student(String name, double score) {
        this.name = name;
        this.score = score;
    }
    public static double calculateAverageScore(Student[] students) {
        double totalScore = 0;
        for (Student student : students) {
            totalScore += student.getScore();
        }
        return totalScore / students.length;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
}
